package cn.edu.scau.cmi.wuzewei.simpleFactoryMethod;

import cn.edu.scau.cmi.wuzewei.domain.AutoInsurance;
import cn.edu.scau.cmi.wuzewei.domain.BodyInjur;
import cn.edu.scau.cmi.wuzewei.domain.Collision;
import cn.edu.scau.cmi.wuzewei.domain.Comprehensive;
import cn.edu.scau.cmi.wuzewei.domain.PersonInjur;

public class PolicyProducer {
	public static AutoInsurance getPolicyObj(int option) {
		AutoInsurance policy = null;

		if (option == 0) {
			policy = new BodyInjur();
		} else if (option == 1) {
			policy = new Collision();
		} else if (option == 2) {
			policy = new PersonInjur();
		} else if (option == 3) {
			policy = new Comprehensive();
		}
		return policy;
	}
}
